package cn.hxzy.course.controller;


import cn.hxzy.common.domain.Professional;
import cn.hxzy.common.response.R;
import cn.hxzy.course.service.ProfessionalService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author niuyi
 * @since 2024-06-22
 */
@RestController
@RequestMapping("/professional")
public class ProfessionalController {
    @Autowired
    private ProfessionalService professionalService;

    //获取所有类型
    @RequestMapping("/select/{id}")
    public R<List<Professional>> select(@PathVariable("id") Integer schoolId) {
        return R.success(professionalService.selectAll(schoolId));
    }


    //根据课程id查询专业
    @RequestMapping("/selectProfessionalName/{courseId}")
    public R<String> selectProfessionalName(@PathVariable("courseId") Integer courseId) {
        return R.success(professionalService.selectProfessionalName(courseId));
    }
}

